home *** CD-ROM | disk | FTP | other *** search
- /* PublishInitFailureMsg.c */
- /*
- * PublishInitFailureMsg.c
- * Copyright © 1994-95 Apple Computer Inc. All rights reserved.
- *
- */
- /* .___________________________________________________________________________________.
- | This function stores a string into the Name Registry. It is called if an |
- | initialization function detects an error that would prevent the driver from |
- | loading. This may help debugging |
- .___________________________________________________________________________________.
- */
-
- #include "NCRDriverPrivate.h"
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Store an error value and text string into the registry.
- */
- void
- PublishInitFailureMsg( /* Initialization failure */
- OSErr errorStatus, /* Writes this value and this */
- ConstStr255Param messageText /* text into the name registry */
- )
- {
- OSErr status;
- RegPropertyValueSize size;
- Str255 work;
-
- Trace(PublishInitFailureMsg);
- PStrCopy(work, (messageText == NULL) ? "\pUnknown reason" : messageText);
- PStrCat(work, "\p: ");
- AppendSigned(work, errorStatus);
- work[++work[0]] = 0; /* C string terminator */
- /*
- * Does the property currently exist - if so, exit so as we only want the first.
- */
- status = RegistryPropertyGetSize( /* returns noErr if the property exists */
- &GLOBAL.deviceEntry,
- kDriverFailurePropertyName,
- &size
- );
- if (status != noErr) {
- status = RegistryPropertyCreate( /* Make a new property */
- &GLOBAL.deviceEntry, /* RegEntryID */
- kDriverFailurePropertyName, /* Property name */
- (RegPropertyValue *) &work[1], /* -> Property contents */
- work[0] /* Property size */
- );
- CheckStatus(status, "\pPublishInitFailureMsg - RegistryPropertyCreate");
- }
- }
-
-
-